<template>
	<view class="page page-fill">
		<view class="header">
			 <view v-if="isUserLogin">
			 <image :src="userInfo.faceImage" class="user-img" mode=""></image>
			 </view>
			 <view class="" v-else>
			 	 <image src="../../static/img/me/meuser.png" class="user-img" mode=""></image>
			 </view>
			
			 <view class="user-info" v-if="isUserLogin">
			 	<view class="user-name">
			 		{{userInfo.nickname}}
			 	</view>
				<view class="user-id">
					ID : {{userInfo.id}}
				</view>
			 </view>
			 <view v-else class="loginRegist">
				 <navigator url="../regist/regist">
					 注册/登录
				 </navigator>
				
			 </view>
			    <navigator url="../meInfo/meInfo">
			 	<image src="../../static/icon/setting-icon.png" class="setting-icon" mode="" v-if="isUserLogin"></image>
				</navigator>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isUserLogin:false,
				userInfo:{}
			}
		},
		onShow(){
		  var userInfo = uni.getStorageSync('globalInfo');
		       if(userInfo!="" && userInfo!=null && userInfo!="undefind"){
				    this.userInfo = userInfo;
					this.isUserLogin = true;
					console.log(this.userInfo)
			   }else{
				   this.isUserLogin = false;
				   this.userInfo = {};
			   }
		},
		methods: {
			
		}
	}
</script>

<style>
 @import url("me.css");
</style>
